#ifndef RKVPSS_H
#define RKVPSS_H
#include <cstdio>
#include <cerrno>
#include <cstring>
#include <cstdlib>
#include <unistd.h>
#include <pthread.h>
#include <sys/stat.h>
#include <sys/poll.h>
#include <sys/types.h>
#include "rk_debug.h"
#include "rk_mpi_vdec.h"
#include "rk_mpi_sys.h"
#include "rk_mpi_mb.h"
#include "rk_mpi_cal.h"
#include "rk_mpi_vo.h"
#include "rk_mpi_vi.h"
#include "rk_mpi_vpss.h"
#include "rk_mpi_venc.h"
#include "test_comm_utils.h"
#include "test_comm_imgproc.h"
#include "test_comm_sys.h"
#include "test_mod_vpss.h"

#define CHN_NORMAL_BUTT   6


typedef struct _ldMpiVPSSCtx {
    uint8_t*   srcFileName[CHN_NORMAL_BUTT];
    const char *dstFilePath;
    RK_S32     s32LoopCount;
    RK_S32     s32VProcDevType;
    RK_S32     s32GrpNum;

    RK_S32     s32ChnNum;
    RK_BOOL    bGrpCropEn;

    RK_S32     s32GrpCropRatio;

    RK_S32  s32SrcWidth;
    RK_S32  s32SrcHeight;
    RK_S32  s32SrcVirWidth;
    RK_S32  s32SrcVirHeight;
    RK_S32  s32SrcCompressMode;
    RK_S32  s32SrcPixFormat;

    struct
    {
        RK_BOOL bChnCropEn;
        RK_S32  s32ChnCropRatio;
        RK_S32  s32DstWidth;
        RK_S32  s32DstHeight;
        RK_S32  s32ChnMode;
        RK_U32  u32ChnDepth;
        RK_S32  s32SrcChnRate;
        RK_S32  s32DstChnRate;
        RK_S32  s32DstPixFormat;
        RK_S32  s32DstCompressMode;
        RK_S32  s32Mirror;
        RK_S32  s32Flip;
    }stChanCfg[VPSS_MAX_CHN_NUM];




    RK_S32  s32GrpRotation;
    RK_S32  s32GrpMirror;
    RK_S32  s32GrpFlip;
    RK_S32  s32Rotation;
    RK_S32  s32RotationEx;


    RK_BOOL bAttachPool;



    RK_S32  s32SrcGrpRate;
    RK_S32  s32DstGrpRate;

    RK_S32  s32GrpIndex;
    MB_POOL attachPool;
} LD_VPSS_CTX_S;

void  rkVpssInit();

void  rkVpssRun(int nMaxChn,const char* pDstFilePath,uint8_t *  pRGBImg[CHN_NORMAL_BUTT]);

void  rkVpssExit();

#endif // RKVPSS_H
